#! /bin/sh

### BEGIN INIT INFO
# Provides: cloudu
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 
# Desciption:
### END INIT INFO

NAMEDOWNAPP=ruoyi-admin.jar

echo $NAMEDOWNAPP
IDDOWNAPP=`ps -ef | grep "$NAMEDOWNAPP" | grep -v "$0" | grep -v "grep" | awk '{print $2}'`
echo $IDDOWNAPP
echo "---------------------------------------------------------"
for id in $IDDOWNAPP
do
kill -9 $id
echo "killed $id"
done
echo "-----------------orderbook app Service have been stopped---------------"

sleep 10s
nohup java -jar $NAMEDOWNAPP -Xms256m -Xmx1024m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=512m > app.out 2>&1 &
echo "----------------orderbook 程序已启动 ps -ef | grep ruoyi-admin -----------"
